/**
 * Created by Administrator on 2014/9/18.
 */

/**
 * 登陆界面
 * @param req
 * @param res
 */
exports.loginView = function(req, res){
  res.render('admin/login/login_view');
}

exports.checkLogin = function(req, res){
  //todo 验证程序
  req.session.activeUser = {id:1, user_name:req.body.user_name};
  res.json(req.session.activeUser);
}

/**
 * 登陆成功
 * @param req
 * @param res
 */
exports.success = function(req, res){
  res.json({activeUser:req.session.activeUser, cookie:req.session.cookie, expire:req.session.cookie.maxAge / 1000});
}
